﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MaxLeaf.Platform.DataContract;
using CommonsLib.DB;
using MaxLeaf.Platform.DALImplementation;
using MaxLeaf.Platform.Functions;
using CommonsLib.Utility;
using MaxLeaf.Platform.Commons;

namespace MaxLeaf.Platform.BLLImplementation
{
    public class poOrderRecvDtlBLL : BaseBLL
    {
        


        public override string FinterIDFields
        {
            get
            {
                return string.Format("{0},{1}", "DtlID", (int)FinterIDType.poOrderRecvDtl);
            }
        }


        internal void SetPosted(DBAccess dbcon, int intKey, int intOrderHdrId, int intOrderDtlId)
        {
            ((poOrderRecvDtlDAL)this.CurrentDAL).SetPosted(dbcon,   intKey,   intOrderHdrId,   intOrderDtlId);
        }

        internal List<int> GetUnpostKeys(int intHdrID)
        {
            using (DBAccess dbcon = DataFunc.GetDBAccessByDataModelType(typeof(poOrderRecvDtlDataModel)))
            {
                return ((poOrderRecvDtlDAL)this.CurrentDAL).GetUnpostKeys(dbcon, intHdrID);
            }
        }

        internal void SetUnPosted(DBAccess dbcon, int intRecvHdrId, int intRecvDtlId, double dblRecvQty)
        {
            ((poOrderRecvDtlDAL)this.CurrentDAL).SetUnPosted(dbcon, intRecvHdrId, intRecvDtlId, dblRecvQty);
        }
    }
}
